package day17.feifei;

import java.io.*;

public class Demo02 {
    public static void main(String[] args) throws IOException {
        File file=new File("D:\\file\\work\\b.txt");
        FileWriter fw=new FileWriter(file);
        fw.write('汪');//字符--->int 写到缓存中
//        fw.flush();
//        fw.close();

        fw.write("文件字符输出流");
//        fw.flush();
//        fw.close();

        char[] chars="雨晴".toCharArray();
        fw.write(chars);
        fw.flush();
        fw.close();
        FileInputStream is=new FileInputStream(file);
        OutputStream op=new FileOutputStream("D:\\file\\b.txt");
        int content;
        while((content=is.read())!=-1){
            op.write(content);
        }
        op.close();
        is.close();
    }
}
